import request from '@/utils/request'
// 抽取出来方便后面使用
const apiUrl = '/admin/product/productSpec'

// 查询所有的产品规格数据
export const FindAllProductSpec = () => {
    return request({
        url: `${apiUrl}`,
        method: 'get',
    })
}

/**
 * 分页查询 商品规格
 * @returns {*}
 */
export const getData = (page, limit) => {
    return request({
        url: `${apiUrl}/${page}/${limit}`,
        method: 'get',
    })
}

// 增加 商品规格
export const save = data => {
    return request({
        url: `${apiUrl}/save`,
        method: 'post',
        data
    })
}

//修改 商品规格
export const update = data => {
    return request({
        url: `${apiUrl}/updateProductSpec`,
        method: 'put',
        data
    })
}

// 删除 商品规格
export const deleteById = id => {
    return request({
        url: `${apiUrl}/${id}`,
        method: 'delete'
    })
}